import request from '@/utils/request'

export default{

    // 1.根据课程ID 获取其章节和小节的数据
    getAllChapterVideo(courseId){
        return request({
            url: `/eduservice/chapter/getChapterVideo/${courseId}`,
            method: 'get'
          })
    },
    // 添加章节
    addChapter(chapter){
        return request({
            url: `/eduservice/chapter/addChapter`,
            method: 'post',
            data:chapter
          })
    },
    // 查询章节 通过id
    getChapter(chapterId){
        return request({
            url: `/eduservice/chapter/getChapterinfo/${chapterId}`,
            method: 'get'
          })
    },
    updateChapter(chapter){
        return request({
            url: `/eduservice/chapter/updateChapter`,
            method: 'post',
            data:chapter
          })
    },
    deleteChapter(chapter){
        return request({
            url: `/eduservice/chapter/${chapterId}`,
            method: 'delete'
          })
    }

}